package tv.youxing.android.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import tv.youxing.android.R;
import tv.youxing.android.entity.MoreClassificationModel;

/**
 * Created by Administrator on 2017/6/25.
 */

public class MoreClassificationAdapter extends BaseAdapter {


    private Context context;
    private List<MoreClassificationModel.ResultBean.AlbumClassifysBean> listDatas = new ArrayList<>();
    private LayoutInflater layoutInflater;

    public MoreClassificationAdapter(Context context, List<MoreClassificationModel.ResultBean.AlbumClassifysBean> listDatas) {
        this.context = context;
        this.listDatas = listDatas;
        layoutInflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);

    }

    @Override
    public int getCount() {
        return listDatas.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View convertView, ViewGroup viewGroup) {
        Holder viewHolder = null;
        if (viewHolder==null) {
            viewHolder = new Holder();
            convertView = layoutInflater.inflate(R.layout.moreclassification_item, null);
            viewHolder.mTextView = convertView.findViewById(R.id.textview);
            convertView.setTag(viewHolder);
        }else{
            viewHolder = (Holder) convertView.getTag();
        }




        viewHolder.mTextView.setText(listDatas.get(i).getAlbum_classify_name());



        return convertView;
    }


    class Holder {

        TextView mTextView;

    }
}


